position_empty


Description

This function will check to see if a given position enters into collision with any instance with a valid collision mask at the given position.


Syntax:

position_empty(x, y);

Argument Description
x The x position to check.
y The y position to check.


Returns:

Boolean


Example:

var xx, yy;
xx = random(room_width);
yy = random(room_height);
if position_empty(xx, yy)
   {
   instance_create_layer(xx, yy, "Bullets", obj_Bomb);
   }

This will check a random position somewhere in the room for a collision and if there is none it will create an instance of obj_Bomb.